﻿@model Model.VenderUser
@{
    ViewBag.Title = "供应商用户管理";
    Layout = "~/Views/Shared/_JQBaseLayOut.cshtml";
}
@section JQscriptSection{
    <script src="../../Scripts/viewsScript/User/UserC.js" type="text/javascript"></script>
    <script src="../../Scripts/viewsScript/Common/MyDialog.js" type="text/javascript"></script>
    <script src="../../Scripts/jqueryeasyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            //加载菜单
            // InitGrid();
            $('#loginOut').click(function () {
                $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {
                    if (r) {
                        $.ajax({
                            type: "POST",
                            url: '@Url.Action("LogOut", "Account")',
                            success: function (data) {
                                location.href = '@Url.Action("LogOn", "Account")';
                            }
                        });
                        }
                });
            })
        });

        function checkusercode()
        {
            var code = $.trim($("#txtUserCode").attr("value"));
            $('#venderuser').form('submit', {
                url: '@Url.Content("~/User/checkUser")',
                 success: function (data) {
                     eval('data=' + data);
                     if (data.success) {
                         @*location.href = '@Url.Action("AddUser", "User")';*@
                    } else {
                         $.messager.alert('错误', data.msg, 'error');
                         $("#txtUserCode").val("").focus();
                        //alert("保存失败！请检查");
                    }
                }
             });
        }
    </script>
}
<body style="background-color:ButtonFace;font-size:17px" onload="InitGrid();">
   
     <div region="north" split="true" border="false" style="overflow: hidden; height: 51px;
        color: #000000; background: url(../Content/Ext/resources/themes/images/gray/panel-header-default-bottom-bg.gif);
        font-family: Verdana, 微软雅黑,黑体">
        <span style="float: right; padding-right: 10px; padding-top: 30px;" class="head">欢迎:@Model.USERNAME <a
            href="#" id="loginOut">安全退出</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/Home/Index" id="HomeIndex">返回首页</a></span>  
            @*<img src="../../Content/themes/base/images/logo.png" height="50" align="absmiddle" />*@
        </span>
        <span style="padding-left:10px; font-size: 20px; ">
            <img src="/Content/images/blocks.gif" width="20" height="20" align="absmiddle" />
             我厨&reg - 查看供应商用户
        </span>
    </div>
       <div id="p2" class="easyui-panel" title="查询条件" style="height: 35px; padding: 5px;
        background: #fafafa;" >
        <table>
            <tr>
                <td>
                    供应商名称:
                </td>
                <td>
                   <select id="SVENDERID" class="easyui-combogrid" name="SVENDERID" style="width: 370px;"
                            data-options="
                        idField:'VENDERID',
                        textField:'VENDERNAME',
                        url:'@Url.Content("/BaseData/VenderList")',
                        columns:[[
                            {field:'VENDERCODE',title:'编码',width:60},
                            {field:'VENDERNAME',title:'名称',width:288}
                        ]]
                    ">
            </select>
                </td>
                <td>
                    
                </td>
                <td>
                    <a id="btnSerach" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="InitGrid()">
                        确定</a>
                </td>
            </tr>
        </table>
    </div>
     
       <div>
            <table id="tab_list">
            </table>
        </div>
         <div id="p1" class="easyui-dialog" style="width:650px;height:240px;padding:10px 20px" closed="true" buttons="#dlg-buttons">
             <form id="venderuser" method="post" @*action='@Url.Content("~/User/Saves")'*@>
       <table>
            <tr>
                <td>
                    用户名:
                </td>
                <td>
                    <input id="txtUserName" name="txtUserName" maxlength="30"  style="width: 154px"/>
                </td>
                <td>
                    登陆名:
                </td>
                <td colspan="2">
                    <input id="txtUserCode" name="txtUserCode" maxlength="20" style="width: 154px" onblur="checkusercode()"/>
                </td>
            </tr>
            <tr>
                <td>
                   密码:
                </td>
                <td>
                    <input id="txtpassword" name="txtpassword" maxlength="30" type="password" style="width: 154px"/>
                </td>
                <td>
                   确认密码:
                </td>
                <td colspan="2">
                    <input id="txtpwd" name="txtpwd" type="password" maxlength="30" style="width: 154px"/>
                </td>
            </tr>
           <tr>
               <td>供应商：</td>
                    <td  colspan="3"><select id="VENDERID" class="easyui-combogrid" name="VENDERID" style="width: 370px;"
                            data-options="
                        idField:'VENDERID',
                        textField:'VENDERNAME',
                        url:'@Url.Content("/BaseData/VenderList")',
                        columns:[[
                            {field:'VENDERCODE',title:'编码',width:60},
                            {field:'VENDERNAME',title:'名称',width:288}
                        ]]
                    ">
            </select>
            </td>
                <td>
                    <a id="btnSave" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-preview'" onclick="save()">
                        保存</a>
                </td>
           </tr>
        </table>
                  </form>
            </div>

       
    </body>

